package neu.dreamera.activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;
import android.widget.ImageView;

import neu.dreamera.R;

/**
 * Created by root on 16-7-22.
 */
public class PictureActivity extends Activity {

    private final String TAG="PictureActivity";
    private EditText picture_title;
    private EditText picture_datetime;
    private EditText picture_time_str;
    private EditText picture_like_count;
    private EditText picture_detail_title;
    private EditText picture_location;

    private ImageView picture_iv;
    private Bitmap picture_map;
    @Override
    public void onCreate(Bundle savedInstanceState){
        Log.d(TAG,"onCreate()");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.picture_item);


        picture_title= (EditText) findViewById(R.id.picture_title);
        picture_datetime= (EditText) findViewById(R.id.picture_datetime);
        picture_time_str= (EditText) findViewById(R.id.picture_time_str);
        picture_like_count= (EditText) findViewById(R.id.picture_like_count);
        picture_detail_title= (EditText) findViewById(R.id.picture_detail_title);
        picture_location= (EditText) findViewById(R.id.picture_location);

        picture_iv= (ImageView) findViewById(R.id.picture_show);

        Intent intent = getIntent();
        Bundle bundle = intent.getExtras();
        //int id=bundle.getInt("id");
        String title=bundle.getString("title");
        String picture=bundle.getString("picture");
        Log.d(TAG,"picture is"+picture);
       // picture_map= BitmapFactory.decodeFile(picture);
        picture_title.setText(title);
        //picture_iv.setImageBitmap(picture_map);
        String datetime=bundle.getString("datetime");
        String time_str=bundle.getString("time_str");
        String detail_title=bundle.getString("detail_title");
        String like_count=bundle.getString("like_count");
        String location=bundle.getString("location");

        picture_datetime.setText(datetime);
        picture_time_str.setText(time_str);
        picture_like_count.setText(like_count);
        picture_detail_title.setText(detail_title);
        picture_location.setText(location);
    }
}
